package com.mesSystem.service.impl.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mesSystem.dto.Result;
import com.mesSystem.entity.ProductionArrange;
import com.mesSystem.mapper.ProductionArrangeMapper;
import com.mesSystem.service.impl.ProductionArrangeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

@Slf4j
@Service
public class ProductionArrangeServiceImpl extends ServiceImpl<ProductionArrangeMapper, ProductionArrange> implements ProductionArrangeService {

    /**
     * 新建一张生产安排表
     * (被OrderController调用，在订单创建时，同时创建一张生产安排表)
     * @param orderId
     * @param processRouteId
     */
    public void increaseOnOrder(Long orderId, Long processRouteId ) {
        ProductionArrange productionArrange = new ProductionArrange();
        log.info(productionArrange.toString());
        productionArrange.setSalesOrderId(orderId);
        productionArrange.setProcessRouteId(processRouteId);
        save(productionArrange);
    }
}
